﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="CarList.aspx.vb" Inherits="Final_Web_2._0_Site.CarList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="Mercedes1SqlDataSource1" AllowSorting="True" 
        DataKeyNames="CarID">
    <Columns>
        


        <asp:TemplateField HeaderText="Picture" SortExpression="CarPicture">
            <ItemTemplate>
           <asp:HyperLink ID="Hyperlink1" NavigateUrl ='<%# Eval("CarID", "Detail.aspx?ID={0}") %>' runat ="server">
           <asp:Image ID="Image1" runat = "server" ImageUrl ='<%# Eval("CarPicture") %>' CssClass ="imageSize" /> 

           </asp:HyperLink>
            </ItemTemplate>
        </asp:TemplateField>



        <asp:BoundField DataField="CarModelName" HeaderText="Model Name" 
            SortExpression="CarModelName" />
        <asp:BoundField DataField="CarModelYear" HeaderText="Model Year" 
            SortExpression="CarModelYear" />
    </Columns>
</asp:GridView>

    <asp:SqlDataSource ID="Mercedes1SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Mercedes1ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:Mercedes1ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [CarModelName], [CarModelYear], [CarPicture], [CarID] FROM [Car]">
    </asp:SqlDataSource>
</asp:Content>
